namespace GPSTrackingClientsWebsiteManager.Espanol.Pages.Reports
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Telerik.Reporting;
    using Telerik.Reporting.Drawing;

    /// <summary>
    /// Summary description for HistoricalReport.
    /// </summary>
    public partial class HistoricalReport : Telerik.Reporting.Report
    {
        public HistoricalReport(string Username)
        {
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //


            this.SDSParameterImei.Parameters["@Username"].Value = Username;
            this.ReportParameters["Imei"].AvailableValues.DataSource = SDSParameterImei;
            this.ReportParameters["Imei"].AvailableValues.DisplayMember = "Name";
            this.ReportParameters["Imei"].AvailableValues.ValueMember = "Imei";


        }

        private void HistoricalReport_NeedDataSource(object sender, EventArgs e)
        {
            //Take the Telerik.Reporting.Processing.Report instance
            Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;

            this.SDSHistoricalReport.Parameters["@Imei"].Value = report.Parameters["Imei"].Value;
            this.SDSHistoricalReport.Parameters["@BeginDate"].Value = report.Parameters["BeginDate"].Value;
            this.SDSHistoricalReport.Parameters["@EndDate"].Value = report.Parameters["EndDate"].Value;

            report.DataSource = SDSHistoricalReport;
        }
    }
}